<html>
<head><meta charset="utf-8"><title>C++ std::thread::hardware_concurrency in the stdlib · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html">C++ std::thread::hardware_concurrency in the stdlib</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="203948489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/203948489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#203948489">(Jul 15 2020 at 12:30)</a>:</h4>
<p>Hi hi; something I've been wanted to have in the stdlib for a while now is a counterpart to C++'s <code>std::thread::hardware_concurrency</code>. The way I was thinking of doing this was by backing it by the <code>num_cpus</code> crate which has all this information already. The one thing I'm not sure about though is what the right API for this would be. Perhaps something like<code>std::env::cpu_count</code>?</p>
<p>Keen to hear thoughts!</p>



<a name="203948665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/203948665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#203948665">(Jul 15 2020 at 12:31)</a>:</h4>
<ul>
<li><a href="https://en.cppreference.com/w/cpp/thread/thread/hardware_concurrency">C++ std::thread::hardware_concurrency</a></li>
<li><a href="https://docs.rs/num_cpus/1.13.0/num_cpus/">num_cpus on crates.io</a></li>
</ul>



<a name="203978601"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/203978601" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#203978601">(Jul 15 2020 at 16:25)</a>:</h4>
<p>It might be worth tracking down that C++ proposal to see if they justify that name, and maybe what alternates they considered.</p>



<a name="203996932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/203996932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#203996932">(Jul 15 2020 at 18:51)</a>:</h4>
<p><span class="user-mention" data-user-id="138448">@cuviper</span> good idea; will do!</p>



<a name="204028561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204028561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204028561">(Jul 16 2020 at 00:00)</a>:</h4>
<p>Does<code>std::thread::hardware_concurrency</code> help one to implement NUMA-aware software?</p>



<a name="204028728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204028728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204028728">(Jul 16 2020 at 00:01)</a>:</h4>
<p>Issues like <a href="https://github.com/rayon-rs/rayon/issues/319">https://github.com/rayon-rs/rayon/issues/319</a> is probably my biggest pet peeve around Rust’s thread pool/runtime/concurrency libraries nowadays.</p>



<a name="204028891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204028891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204028891">(Jul 16 2020 at 00:02)</a>:</h4>
<blockquote>
<p>If the value is not well defined or not computable, returns ​0​. </p>
</blockquote>
<p>Wow what a bad choice. If you pass it directly into the thread pool thread count, you’re going to sometimes get 0 threads...</p>



<a name="204032186"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204032186" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204032186">(Jul 16 2020 at 00:48)</a>:</h4>
<p>it's just a plain count, presumably logical cpus</p>



<a name="204032213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204032213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204032213">(Jul 16 2020 at 00:49)</a>:</h4>
<p>but I guess it might return something fancy on GPUs or something</p>



<a name="204058899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204058899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204058899">(Jul 16 2020 at 08:44)</a>:</h4>
<p><span class="user-mention" data-user-id="123586">@nagisa</span> judging from the docs<code>num_cpus</code> luckily doesn't return less than 1 <a href="https://docs.rs/num_cpus/1.13.0/num_cpus/fn.get.html">https://docs.rs/num_cpus/1.13.0/num_cpus/fn.get.html</a> -- agree the C++ variant is uhh, _not ideal_ haha</p>



<a name="204069071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204069071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204069071">(Jul 16 2020 at 10:56)</a>:</h4>
<p>After some archeology it seems that the first introduction of <code>hardware_concurrency</code> was in Boost 0.35, released in March 2008: <a href="https://www.boost.org/doc/libs/1_35_0/doc/html/thread/thread_management.html#thread.thread_management.thread.hardware_concurrency">https://www.boost.org/doc/libs/1_35_0/doc/html/thread/thread_management.html#thread.thread_management.thread.hardware_concurrency</a></p>



<a name="204069119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204069119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204069119">(Jul 16 2020 at 10:57)</a>:</h4>
<p>They cite this is so they can be closer to the C++ 0x working draft: <a href="https://www.boost.org/users/history/version_1_35_0.html">https://www.boost.org/users/history/version_1_35_0.html</a></p>



<a name="204104759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204104759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204104759">(Jul 16 2020 at 16:02)</a>:</h4>
<p>Yay, found the paper that first mentions <code>hardware_concurrency</code>: Multi-threading Library for Standard C++, N2320 (2017) -- <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2320.html">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2320.html</a></p>



<a name="204104802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204104802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204104802">(Jul 16 2020 at 16:02)</a>:</h4>
<p>It also doesn't feature any form of discussion on the topic <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span> -- so that's not helpful here haha</p>



<a name="204105151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204105151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204105151">(Jul 16 2020 at 16:05)</a>:</h4>
<p>Also potentially of note is that we <em>already</em> basically ship this in libtest anyway, so moving to libstd seems good in that respect</p>



<a name="204105202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204105202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204105202">(Jul 16 2020 at 16:05)</a>:</h4>
<p>The way we tracked this down was fun though: doing a binary search over the C++ 11 drafts looking for <code>hardware_concurrency</code> through the various years of <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/</a> -- ended up finding a 6 month date range and found the corresponding paper (:</p>



<a name="204105396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204105396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204105396">(Jul 16 2020 at 16:06)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> oh cool! -- by that do you mean <code>std::test</code>, or just internally? -- would love to take a look</p>



<a name="204105445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204105445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204105445">(Jul 16 2020 at 16:07)</a>:</h4>
<p>just internally</p>



<a name="204105503"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204105503" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204105503">(Jul 16 2020 at 16:07)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/src/libtest/helpers/concurrency.rs">https://github.com/rust-lang/rust/blob/master/src/libtest/helpers/concurrency.rs</a></p>



<a name="204106352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204106352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204106352">(Jul 16 2020 at 16:13)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> oh amazing; yeah I guess a PR would then essentially just be moving some code around</p>



<a name="204106412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204106412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204106412">(Jul 16 2020 at 16:14)</a>:</h4>
<p>yeah that's my expectation</p>



<a name="204106440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204106440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204106440">(Jul 16 2020 at 16:14)</a>:</h4>
<p>putting it in std also means we're far more likely to get ports as we introduce more targets</p>



<a name="204106442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204106442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204106442">(Jul 16 2020 at 16:14)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> do you have any opinions on what this should be named / which submodule to place it in? I'm torn between <code>std::env</code> and <code>std::thread</code></p>



<a name="204106482"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204106482" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204106482">(Jul 16 2020 at 16:14)</a>:</h4>
<p>I think thread makes more sense personally, if only because std::env feels more "grab bag"</p>



<a name="204106527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204106527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204106527">(Jul 16 2020 at 16:15)</a>:</h4>
<p>if you're accessing this you're probably doing it as part of working with threads, too, so more discoverable</p>



<a name="204106540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204106540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204106540">(Jul 16 2020 at 16:15)</a>:</h4>
<p>yeah, fair</p>



<a name="204106574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204106574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204106574">(Jul 16 2020 at 16:15)</a>:</h4>
<p>has prior art in C++ as well so might make sense to go with what's familiar</p>



<a name="204108966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204108966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204108966">(Jul 16 2020 at 16:33)</a>:</h4>
<p>Oki wrote a draft proposal: <a href="https://paper.dropbox.com/doc/2020-07-16-cpu-count-in-stdlib--A33In0_WCX9fhdqn~XlGxEfCAg-a6hEDlixdJadxrQ79lbBs">https://paper.dropbox.com/doc/2020-07-16-cpu-count-in-stdlib--A33In0_WCX9fhdqn~XlGxEfCAg-a6hEDlixdJadxrQ79lbBs</a></p>



<a name="204108990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204108990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204108990">(Jul 16 2020 at 16:33)</a>:</h4>
<p>Don't think we'd need a full RFC for this, right?</p>



<a name="204109347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204109347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204109347">(Jul 16 2020 at 16:36)</a>:</h4>
<p><code>cpu_count</code> doesn't seem like the best name to me, but <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span> on having this functionality in libstd!</p>



<a name="204109827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204109827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204109827">(Jul 16 2020 at 16:40)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> if you have any suggestions for a different name; I'd love to hear!</p>



<a name="204110097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204110097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204110097">(Jul 16 2020 at 16:42)</a>:</h4>
<p><code>hardware_threads</code>? <code>hardware_concurrency</code> also doesn't sound bad tbh.</p>
<p><code>cpu_count</code> sounds like it would return 1 except on NUMA systems.</p>



<a name="204110900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204110900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204110900">(Jul 16 2020 at 16:49)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> oh yeah truu -- there's also probably a good case to be made that if <code>hardware_concurrency</code> doesn't sound particularly out of place that we should default to just naming it that</p>



<a name="204111022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204111022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204111022">(Jul 16 2020 at 16:50)</a>:</h4>
<p>"hardware threads" terminology is also fairly established. For example the RISC-V spec uses it (just abbreviated as "hart").</p>



<a name="204112015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204112015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204112015">(Jul 16 2020 at 16:59)</a>:</h4>
<p><span class="user-mention" data-user-id="211727">@Jonas Schievink</span> do you have a link to that by any chance?</p>



<a name="204113056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204113056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204113056">(Jul 16 2020 at 17:07)</a>:</h4>
<p><a href="https://riscv.org/specifications/isa-spec-pdf/">https://riscv.org/specifications/isa-spec-pdf/</a> pdf page 20</p>



<a name="204113062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204113062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204113062">(Jul 16 2020 at 17:07)</a>:</h4>
<p>In "Volume I: User-Level ISA", Chapter 1.1 RISC-V Hardware Platform Terminology:</p>
<blockquote>
<p>A component is termed a core if it contains an independent instruction fetch unit. A RISC-V-compatible core might support multiple RISC-V-compatible hardware threads, or harts, through multithreading.</p>
</blockquote>



<a name="204115669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204115669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204115669">(Jul 16 2020 at 17:27)</a>:</h4>
<p>Let's not call the function harts but hardware threads seems fine</p>



<a name="204117298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204117298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204117298">(Jul 16 2020 at 17:40)</a>:</h4>
<p>Yeah I didn't mean to suggest "harts" literally</p>



<a name="204263758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204263758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204263758">(Jul 17 2020 at 21:49)</a>:</h4>
<p>I'd love to see this as well, and <code>std::thread::hardware_threads()</code> seems like a fine name.</p>



<a name="204263847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204263847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204263847">(Jul 17 2020 at 21:50)</a>:</h4>
<p>We should account for systems that have no concept of this, though. For instance, a WebAssembly or asm.js target might have some concept of threads but might not have access to any information about the number of hardware threads.</p>



<a name="204263864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204263864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204263864">(Jul 17 2020 at 21:50)</a>:</h4>
<p>I think it'd be reasonable for it to return an <code>Option&lt;usize&gt;</code>.</p>



<a name="204263898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204263898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204263898">(Jul 17 2020 at 21:50)</a>:</h4>
<p>That way, a caller won't just blithely use it as "number of threads to spawn" without thinking about the right default for them.</p>



<a name="204263940"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204263940" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204263940">(Jul 17 2020 at 21:51)</a>:</h4>
<p>(Another option would be <code>Option&lt;NonZeroUsize&gt;</code>.)</p>



<a name="204266889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204266889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204266889">(Jul 17 2020 at 22:29)</a>:</h4>
<p>Ah yeah fair enough! — I like <code>Option&lt;NonZeroUsize&gt;</code> quite a bit here as well 😊</p>



<a name="204271435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204271435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204271435">(Jul 17 2020 at 23:37)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="204302536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204302536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204302536">(Jul 18 2020 at 14:27)</a>:</h4>
<p>Okk, got most of a patch done — walking the cats real quick and will submit. Should have it up in an hour or so ✨</p>



<a name="204305382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204305382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204305382">(Jul 18 2020 at 15:47)</a>:</h4>
<p>Filed a PR! <a href="https://github.com/rust-lang/rust/pull/74480">https://github.com/rust-lang/rust/pull/74480</a></p>



<a name="204314383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204314383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Leo Le Bouter <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204314383">(Jul 18 2020 at 19:29)</a>:</h4>
<p>from what I can read in glibc docs, num_cpus can give 0 cpus</p>



<a name="204314884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204314884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204314884">(Jul 18 2020 at 19:44)</a>:</h4>
<p><span class="user-mention" data-user-id="214522">@Leo Le Bouter</span> oh that's good to know! Looking at the code now it seems like we handle that case internally by just setting it to 1 instead. <a href="https://github.com/rust-lang/rust/pull/74480#issuecomment-660531159">https://github.com/rust-lang/rust/pull/74480#issuecomment-660531159</a> suggests we should return <code>Result</code> instead of <code>Option</code> as well, so perhaps <code>io::Result&lt;usize&gt;</code> is the better signature.</p>



<a name="204317047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204317047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204317047">(Jul 18 2020 at 20:46)</a>:</h4>
<p><span class="user-mention" data-user-id="214522">@Leo Le Bouter</span> ah, I believe we already guard against that case though -- if 0 cpus are returned, it's set back to 1. Which I think is the intuitive behavior; don't think anyone would ever expect 0 to be returned if the call was successful.</p>



<a name="204317130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204317130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204317130">(Jul 18 2020 at 20:49)</a>:</h4>
<p>actually; just made that an error -- think that's the right approach</p>



<a name="204859578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204859578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204859578">(Jul 23 2020 at 22:14)</a>:</h4>
<p>In <a href="https://github.com/rust-lang/rust/pull/74480#issuecomment-662045841">https://github.com/rust-lang/rust/pull/74480#issuecomment-662045841</a> the name <code>available_concurrency</code> was suggested; how do people feel about that?</p>



<a name="204859669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204859669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yoshua Wuyts <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204859669">(Jul 23 2020 at 22:15)</a>:</h4>
<p>Overall the thread seems to have gathered quite a bit of attention; wasn't expecting that <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="204990475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204990475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204990475">(Jul 25 2020 at 06:09)</a>:</h4>
<p>That name change seems like an improvement to me.</p>



<a name="204990476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/C%2B%2B%20std%3A%3Athread%3A%3Ahardware_concurrency%20in%20the%20stdlib/near/204990476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/C.2B.2B.20std.3A.3Athread.3A.3Ahardware_concurrency.20in.20the.20stdlib.html#204990476">(Jul 25 2020 at 06:09)</a>:</h4>
<p><span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>